import java.io.*;
import java.lang.Math;

public class Test17 {
    public static void main(String[] args) throws IOException {
        String fileName = "D:\\Java\\valueOfPowerOf2.html";

        FileWriter out = new FileWriter(fileName);

        for (int i = 0; i < 10; i++) {
            System.out.println((int)Math.pow(2, i));
            out.write(Math.pow(2, i) + "\n");
        }

        out.close();

        FileReader in = new FileReader(fileName);

        int line = in.read();

        while (line != -1) {
            System.out.println(line);
            line = in.read();
        }

        in.close();
    }
}
